<script setup>
import { useUserStore } from "./stores/user";
import { useRouter } from "vue-router";
import withPlay from "./components/withPlay.vue";
const router = useRouter();
const userStore = useUserStore();

if (userStore.user) {
  // console.log(userStore.user);
  if (!userStore.user.username) {    
    if(router.currentRoute.path== "/login/login"){
      router.push("/login");
    }else if(router.currentRoute.path== "/login/reg"){
      router.push("/login/reg");
    }
  }
}
</script>

<template>
  <router-view></router-view>
  <withPlay></withPlay>
</template>

<style></style>
